Grant's CGI Framework is a framework for writing 68K & PowerPC Macintosh CGI applications in C. The user of the framework only needs to modify one function (located in its own file) to produce a custom CGI - all the other details can be left to the framework. However, there are numerous options for customization available for those who need them.
Macintosh programming experience is not required (although it helps) - but at least a basic knowledge of the ANSI C language is required.
Features:
* 68K and PowerPC native support
* Multi-Threading (thread support requires Apple's Thread Manager or System 7.5)
* Automatic html form parsing with easy function access to individual fields
* Asynchronus CGI (ACGI)
* ListSTAR trigger and action events
* AppleScriptable for testing without a server or MacTCP
* Optional compile as faceless background-only application
* Numerous configuration options for optimizing to your specific needs
* Optional self-quitting after specified idle time
* Significant performance increase over scripts such as those in AppleScript and Perl
* Metrowerks and Symantec project files
* If you use it to write free applications, it's free to use.
Getting Started
The 'Documentation' folder contains some instructions on how to use the framework, the version history (some items are only documented in the version history, so read it!) and the 'License and Limited Warranty'. If you read through the entire documentation (shouldn't take very long because there's not all that much, yet), look at the source code, and still don't understand something, ask about it on the mailing list or by email directly to Grant. (addresses later in this doc)
Notes:
The PowerPC compatibility has been tested by others, but I haven't seen it myself (I'm on a 680x0 system). If you want extensive and robust testing please buy me a PowerMac! <grin> No, really, please feel welcome to buy me any model of PowerMac - or even a hand-me-down! (I'd accept lobbying of Apple to give me a nice discount as an alternative :-)
Project files for earlier versions of Codewarrior can be made available. Please send email to grant@acm.org requesting the particular version you want.
I've only added basic support for ListSTAR trigger and action events in the current version. For those who don't want both CGI and ListSTAR events in their application, it is easy to remove the ListSTAR or CGI support from the project (I'll eventually be distributing them as separate projects, but it's easier for me to do them as one, for now) See the section on "Building a ListSTAR tool" at the end of the documentation for instructions on using or not using ListSTAR and CGI events.
For specifics on what you have to pay for using this software and code (if you're not using it to create freeware), please refer to the "Royalties" file in the "Documentation" folder.
This is beta software but it seems to generally work without problems! Don't bet your life on it though...
Further Information About This Framework
World Wide Web home page:
http://arpp.carleton.ca/grant/mac/grantscgi/
Grant's CGI Discussion, Announcements, and the Source Updates mail lists:
I've set up a mailing list for discussing this framework. It is intended to be a forum for information, ideas, questions and announcements about about writing CGIs (and the CGIs that have been written) using Grant's CGI Framework.
Send a message with the command "subscribe" (without quotes) as the subject to:
grantcgi@arpp.carleton.ca
There is a list for those who only want the announcements - no discussion. It is mutually-exclusive with the grantcgi list, meaning that you can only subscribe to one of them since all the postings to grantcgi-announce are also made to grantcgi.
Send a message with the command "subscribe" (without quotes) as the subject to:
grantcgi-announce@arpp.carleton.ca
You can also subscribe to a mailing list which will send you periodic updates to the framework as they are released (both interm and regular releases). All updates are sent as Stuffit attachments (HQX MIME format). The archives are not sent to either of the two other lists.
Send a message with the command "subscribe" (without quotes) as the subject to:
grantcgi-source@arpp.carleton.ca
If you want more details on any of the lists, just send the command "help" instead of "subscribe".
A list of mirrors of the Info-Mac site is at: http://arpp.carleton.ca/doc/mac/tool/info-mac-mirrors.html
Apprentice CD "The Definitive Collection of Source Code and Utilities for Mac Programmers" <http://www.celestin.com/apprentice/> includes a copy of version On Apprentice 3: "Apprentice:Source Code:C:Frameworks:Grant's CGI Framework:"
On the "CDWeb" Vol. 11 CD included with the Japanese "Internet User" Magazine, 1995 No. 12. in "CDWeb Vol. 11:Starter Kit:WWW:Server:CGI:grants-cgi-framework-10b10:"
My list seems to grow faster than I get things on it done... With this in mind, I'll encourage you once again to contribute your feature requests. Please take special note of the last section of this list and let me know if you can contribute to any of the items there. Help and suggestions are always welcome with all aspects of the framework.
These are the BIG areas I plan to work on over the next while:
* Send Partial
* WebSTAR CFM Plug-in support
These are the ongoing struggles:
* documentation
* Locating and fixing bugs
These are more areas that I hope to get around to sooner rather than later:
* Sample applications
* preferences interface and file
* Use resources for storing some of the variables (number of threads,
quit idle time,...)
* Status window: current threads, total events handled, total errors, etc.
* make alerts modeless so they don't freeze up the system
* Low-priority status updating and deferred tasks sub-threads.
* Determine server name for http headers
* Determine CGI Type (IE. ACGI, CGI, Action, Preprocessor, Postprocessor)
* Default page(s) returning mechanism
* Determine server root directory
* function for MacHTTP/WebSTAR style log entry
* DNS functions
These are items that can't fit on my plate right now, but which I do hope
to get around to sometime this century.
* Functions for sending ListSTAR and WebSTAR control events
* Support WebSTAR 'Reporting' events
* Allow event passing for CGI daisy-chaining
These are things I could use some help with:
* Write some useful test scripts
* MPW support
* MacAPP, PowerPlant and THINK Class Library C++ CGI class integration
* Pascal version (someone is actually helping me with this! More help is
always welcome, though)
* Support unix cgi variables for easier porting from unix
* A unix code shell for easier porting to unix
* AppleGuide, QuickView, THINK Reference, ObiWan, etc. online reference(s)
* Profile and optimize the code
* HTTP file upload
Acknowledgements
The following are some of the people (alphabetically listed) who've contributed to and affected this framework (But don't blame them for the outcome, please. It's all my fault.)
Scott T Boyd and a bunch of others who were at MacHack'95 affected my thinking about this code.
Gregory S. Combs identified the now corrected PowerPC compiler errors and supplied the initial PPC format project file for CodeWarrior and some code snippets. He's also made various other useful comments & contributions.
Rick Hartmann of Symantec Macintosh Dev Tools Support helped me figure out my problems getting the framework to compile with Symantec's tools.
Steve Johnson was another person who identified the now corrected PowerPC compiler errors.
Frank Leahy has been giving a number of good suggestions and has also identified some bugs.
Peter N Lewis and Quinn developed the Internet Config system.
John Norstad's MailTools Gateway was another framework I looked at, but decided the code was too obscure for my very particular code style tastes. (Not that my code is necessarily any less obscure - just differently so ;-)
John O'Fallon wrote the "Responder" source which inspired this framework. Although I did the whole thing over from scratch to suit my own purposes. See his site: http://www.maxum.com/maxum/
Chuck Shotton, author of MacHTTP™ and WebSTAR™, answered some of my questions along the way, and kindly granted permission to include his cgi_params page with the framework.
Stefan Strand of "Teknik i Media AB" identified my off-by-one error in the 'CGIDecodeSpecialChars' function (now fixed).
Scott Taylor pointed out the missing '/' in my TITLE tags in the sample html, as well as a bug in 'startupTrapAvailable'.
Wayne K. Walrath identified (and helped solve) my previously bad design of AppleEvent threading.
The WebSTAR™ documentation provided the details of the WWWΩsdoc AppleEvent.
And, with much pride, I can now thank the registered users who are financially supporting my work. It is much appreciated!
About the Author
I, Grant Neufeld, as of this writing, am an applications programmer for InfoDesign Corporation. My current project there is the Macintosh part of a workflow management system (WorkSMART™). The company also does some good SGML training and systems integration. They can be contacted at info@idc.com. They have absolutely nothing to do with this project and are in no way associated with it or responsible for any aspect of it (except that they pay my salary, which pays for food, which keeps me alive, which is a necessary factor in my ability to produce this stuff.)
See my vanity page for more insight into who I am and what I do (and how vain I am):
http://arpp.carleton.ca/grant/
Contacting me:
gneufeld@ccs.carleton.ca (At least until May 1996)
grant@acm.org
grant@kagi.com
____________________
StarNine, ListSTAR, and WebSTAR are trademarks of StarNine Technologies, Inc.
AppleScript, Macintosh, Mac, and MacTCP are trademarks or registered trademarks of Apple Computer, Inc.
UNIX is a registered trademark of Novell, Inc.
CodeWarrior is a trademark of Metrowerks Inc.
Symantec is a trademark of Symantec Corporation.
WorkSMART is a trademark of InfoDesign Corporation.
Grant's CGI Framework is, for those who even bother to read the small print, a GrantMark and a TradeMark of Grant Neufeld.